package leetcode.weekly.week315;

//Solution3Test
public class Solution3 {
	public boolean sumOfNumberAndReverse(int num) {
		for (int i = 0; i <= num; i++) {
			if (i + this.f(i) == num) {
				return true;
			}
		}
		return false;
	}

	private int f(int num) {
		int ans = 0;
		while (num > 0) {
			int last = num % 10;
			ans = ans * 10 + last;
			num /= 10;
		}
		return ans;
	}
}
